#include "string.h"

void test01()
{
	bit::string s1;
	cout << s1.c_str() << endl;

	bit::string s2("hello world");
	cout << s2.c_str() << endl;

	s2[0] = 'x';
	cout << s2.c_str() << endl;

	bit::string::iterator it1 = s2.begin();
	while (it1 != s2.end())
	{
		(*it1)++;
		it1++;
	}
	cout << s2.c_str() << endl;

	for (char& ch : s2)
	{
		ch++;
		cout << ch << " ";
	}
}

void test02()
{
	bit::string s2("hello world");
	cout << s2.c_str() << endl;

	//s2 += "! 666";
	//cout << s2.c_str() << endl;

	//s2.insert(5, "0000");
	//cout << s2.c_str() << endl;

	//s2.erase(2, 3);
	//cout << s2.c_str() << endl;

	cout << s2.find(' ') << endl;
	cout << s2.find("wor") << endl;
}

void test03()
{
	bit::string s2("he/llo wo/rld");
	size_t find1=s2.find('/');
	cout << find1 << endl;
	//cout << s2.find('/', s2.find('/'))<<endl;

	size_t find2 = s2.find("wo");
	cout << find2 << endl;
}

void test04()
{
	bit::string s1("hello world");
	bit::string s2(s1);
	s2[0] = 'x';

	bit::string s3("1");
	s3 = s1;
	s1 = s1;
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
	cout << s3.c_str() << endl;
}

void test05()
{
	bit::string s1("hello world");
	bit::string s2("hello world");
	//cout << (s1 == s2) << endl;
	//cout << (s1 > s2) << endl;
	//cout << (s1 < s2) << endl;
	//cout << (s1 != s2) << endl;
	//cout << ("hello world" == s1) << endl;
	cout << s1 << endl;

	getline(cin, s1,'x');
	cout << s1 << endl;
}
int main()
{
	test04();
	return 0;
}